﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;


namespace Software_2Project.DB_Layer
{
    class DB_LogForm
    {
        public string connectStr =
        "Data Source=crespooo;Initial Catalog=ATM;Integrated Security=True";

        SqlConnection connec = new SqlConnection();
        DataTable dt = new DataTable();

        public DataTable retrieve(Int32 acconum, Int32 password)
        {
            connec.ConnectionString = connectStr;
            try
            {
                if (ConnectionState.Closed == connec.State)
                    connec.Open();

                SqlCommand cmd = new SqlCommand("SELECT acconum,password FROM bank ", connec);
                SqlDataReader rd = cmd.ExecuteReader();
                dt.Load(rd);              
            }

            catch
            {
                connec.Close();
                //throw;
            }
            return dt;
        }
    }
}
